#ifndef INCLUDED_format_tools_InflateImpl
#define INCLUDED_format_tools_InflateImpl

#ifndef HXCPP_H
#include <hxcpp.h>
#endif

HX_DECLARE_CLASS2(format,tools,HuffTools)
HX_DECLARE_CLASS2(format,tools,Huffman)
HX_DECLARE_CLASS2(format,tools,InflateImpl)
HX_DECLARE_CLASS3(format,tools,_InflateImpl,State)
HX_DECLARE_CLASS3(format,tools,_InflateImpl,Window)
HX_DECLARE_CLASS2(haxe,io,Bytes)
HX_DECLARE_CLASS2(haxe,io,Input)
namespace format{
namespace tools{


class InflateImpl_obj : public hx::Object{
	public:
		typedef hx::Object super;
		typedef InflateImpl_obj OBJ_;
		InflateImpl_obj();
		Void __construct(::haxe::io::Input i,Dynamic __o_header,Dynamic __o_crc);

	public:
		static hx::ObjectPtr< InflateImpl_obj > __new(::haxe::io::Input i,Dynamic __o_header,Dynamic __o_crc);
		static Dynamic __CreateEmpty();
		static Dynamic __Create(hx::DynamicArray inArgs);
		~InflateImpl_obj();

		HX_DO_RTTI;
		static void __boot();
		static void __register();
		void __Mark(HX_MARK_PARAMS);
		void __Visit(HX_VISIT_PARAMS);
		::String __ToString() const { return HX_CSTRING("InflateImpl"); }

		int nbits; /* REM */ 
		int bits; /* REM */ 
		::format::tools::_InflateImpl::State state; /* REM */ 
		bool final; /* REM */ 
		::format::tools::Huffman huffman; /* REM */ 
		::format::tools::Huffman huffdist; /* REM */ 
		::format::tools::HuffTools htools; /* REM */ 
		int len; /* REM */ 
		int dist; /* REM */ 
		int needed; /* REM */ 
		::haxe::io::Bytes output; /* REM */ 
		int outpos; /* REM */ 
		::haxe::io::Input input; /* REM */ 
		Array< int > lengths; /* REM */ 
		::format::tools::_InflateImpl::Window window; /* REM */ 
		virtual ::format::tools::Huffman buildFixedHuffman( );
		Dynamic buildFixedHuffman_dyn();

		virtual int readBytes( ::haxe::io::Bytes b,int pos,int len);
		Dynamic readBytes_dyn();

		virtual int getBits( int n);
		Dynamic getBits_dyn();

		virtual bool getBit( );
		Dynamic getBit_dyn();

		virtual int getRevBits( int n);
		Dynamic getRevBits_dyn();

		virtual Void resetBits( );
		Dynamic resetBits_dyn();

		virtual Void addBytes( ::haxe::io::Bytes b,int p,int len);
		Dynamic addBytes_dyn();

		virtual Void addByte( int b);
		Dynamic addByte_dyn();

		virtual Void addDistOne( int n);
		Dynamic addDistOne_dyn();

		virtual Void addDist( int d,int len);
		Dynamic addDist_dyn();

		virtual int applyHuffman( ::format::tools::Huffman h);
		Dynamic applyHuffman_dyn();

		virtual Void inflateLengths( Array< int > a,int max);
		Dynamic inflateLengths_dyn();

		virtual bool inflateLoop( );
		Dynamic inflateLoop_dyn();

		static Array< int > LEN_EXTRA_BITS_TBL; /* REM */ 
		static Array< int > LEN_BASE_VAL_TBL; /* REM */ 
		static Array< int > DIST_EXTRA_BITS_TBL; /* REM */ 
		static Array< int > DIST_BASE_VAL_TBL; /* REM */ 
		static Array< int > CODE_LENGTHS_POS; /* REM */ 
		static ::format::tools::Huffman FIXED_HUFFMAN; /* REM */ 
		static ::haxe::io::Bytes run( ::haxe::io::Input i,Dynamic bufsize);
		static Dynamic run_dyn();

};

} // end namespace format
} // end namespace tools

#endif /* INCLUDED_format_tools_InflateImpl */ 
